from test1.student_system.database.base_db import DatabaseManager

class StudentDB(DatabaseManager):
    # def __init__(self):
        # super().__init__()
    def fetch_students(self):
        #print(123)
        query = """select s.*,c.class_name,(s.chinese_score+s.math_score+s.english_score) as total_score
from student s
join classes c on s.class_id=c.class_id"""
        return self.fetch_query(query)

# if __name__ == '__main__':
#     with StudentDB() as db:
#         query = "SELECT * FROM student"
#         students = db.fetch_students()
#         print(students)